package com.station.server.entity;

import com.station.client.proxies.PSize;

import javax.persistence.*;

/**
 * User: JinJavaMojo
 * Date: 25.09.13
 */

@Embeddable
public class Size {

    public Size() {
    }

    public Size(int width, int height) {
        this.width = width;
        this.height = height;
    }

    @Column(name = "WIDTH")
    public int width;

    @Column(name = "HEIGHT")
    public int height;

    public static Size transform(PSize pSize) {
        if (pSize != null)
            return new Size(pSize.width,pSize.height);
        else
            return new Size();
    }
}
